package com.shop2cn.iapi.coupon.service;

import java.util.List;

import org.json.JSONObject;

import com.shop2cn.iapi.coupon.parameter.CheckCouponsData;
import com.shop2cn.iapi.coupon.parameter.GetUserValidSellerCouponsResp;
import com.shop2cn.iapi.coupon.parameter.SellerCouponsList;
import com.shop2cn.iapi.coupon.parameter.UserReceiveResultInfo;
import com.shop2cn.iapi.coupon.parameter.GetUserValidSellerCouponsResp.CouponDto;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取用户已领买手有效的优惠券列表Call
*FreeMaker Template自动生成代码
*/
public class getUserValidSellerCouponsCall extends YmatouBaseCall{
	private static String opurl ="api/Promotion/getUserValidSellerCoupons";
	
	public getUserValidSellerCouponsCall() {
		super(EnvSetup.getSystemUrl("coupon_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	
	  public String getStatusCode1()
	    {
	        return getString("statusCode");
	    }

	    public String getMessage()
	    {
	        return getString("message");
	    }

		public String getData() {
			String Code = null;
			try {
				Code = new JSONObject(getReturnData()).getString("data");
			} catch (Exception e) {
				e.printStackTrace();
			}
			return Code;
		}

	    public GetUserValidSellerCouponsResp getSellerCouponsList()
	    {
	    	GetUserValidSellerCouponsResp data = null;
	        try {
	         data = (GetUserValidSellerCouponsResp) FormatUtil.GSONToObject(getString("data"),
	        		 GetUserValidSellerCouponsResp.class);
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	        return data;
	    }
}